package com.ruoyi.bus.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.bus.mapper.WitAppointMapper;
import com.ruoyi.bus.domain.WitAppoint;
import com.ruoyi.bus.service.IWitAppointService;

/**
 * 车辆预约Service业务层处理
 * 
 * @author caiyanshan
 * @date 2021-04-14
 */
@Service
public class WitAppointServiceImpl implements IWitAppointService 
{
    @Autowired
    private WitAppointMapper witAppointMapper;

    /**
     * 查询车辆预约
     * 
     * @param appointId 车辆预约ID
     * @return 车辆预约
     */
    @Override
    public WitAppoint selectWitAppointById(Long appointId)
    {
        return witAppointMapper.selectWitAppointById(appointId);
    }

    /**
     * 查询车辆预约列表
     * 
     * @param witAppoint 车辆预约
     * @return 车辆预约
     */
    @Override
    public List<WitAppoint> selectWitAppointList(WitAppoint witAppoint)
    {
        return witAppointMapper.selectWitAppointList(witAppoint);
    }

    /**
     * 新增车辆预约
     * 
     * @param witAppoint 车辆预约
     * @return 结果
     */
    @Override
    public int insertWitAppoint(WitAppoint witAppoint)
    {
        witAppoint.setCreateTime(DateUtils.getNowDate());
        return witAppointMapper.insertWitAppoint(witAppoint);
    }

    /**
     * 修改车辆预约
     * 
     * @param witAppoint 车辆预约
     * @return 结果
     */
    @Override
    public int updateWitAppoint(WitAppoint witAppoint)
    {
        return witAppointMapper.updateWitAppoint(witAppoint);
    }

    public int updateWitAppointByPlanId(WitAppoint witAppoint){
        return witAppointMapper.updateWitAppointByPlanId(witAppoint);
    }

    /**
     * 批量删除车辆预约
     * 
     * @param appointIds 需要删除的车辆预约ID
     * @return 结果
     */
    @Override
    public int deleteWitAppointByIds(Long[] appointIds)
    {
        return witAppointMapper.deleteWitAppointByIds(appointIds);
    }

    /**
     * 删除车辆预约信息
     * 
     * @param appointId 车辆预约ID
     * @return 结果
     */
    @Override
    public int deleteWitAppointById(Long appointId)
    {
        return witAppointMapper.deleteWitAppointById(appointId);
    }
    
    public int updateOverAppoint(WitAppoint witAppoint){
        return witAppointMapper.updateOverAppoint(witAppoint);
    }
    
    public int updateNotOverAppoint(WitAppoint witAppoint){
        return witAppointMapper.updateNotOverAppoint(witAppoint);
    }

    public List<WitAppoint> selectInCarCount(WitAppoint appoint){
        return witAppointMapper.selectInCarCount(appoint);
    }
    
    public int updateWitAppointStatus(){
        return witAppointMapper.updateWitAppointStatus();
    }
    
    public int updateTestOverAppoint(WitAppoint witAppoint){
        return witAppointMapper.updateTestOverAppoint(witAppoint);
    }
}
